All files / vidly/startup logging.js

85.71% Statements 6/7
100% Branches 0/0
50% Functions 1/2
85.71% Lines 6/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 182x   2x   2x 2x     2x       2x          
const winston = require('winston');
// require('winston-mongodb');
require('express-async-errors');
 
module.exports = function() {
  winston.handleExceptions(
    new winston.transports.File({ filename: 'uncaughtExceptions.log' }));
  
  process.on('unhandledRejection', (ex) => {
    throw ex;
  });
  
  winston.add(winston.transports.File, { filename: 'logfile.log' });
  // winston.add(winston.transports.MongoDB, { 
  //   db: 'mongodb://localhost/vidly',
  //   level: 'info'
  // });  
}